package io.renren.wechat.service.token.dto;

import com.alibaba.fastjson.annotation.JSONField;
import lombok.Data;

import java.io.Serializable;

@Data
public class AccessTokenResponse implements Serializable {

    public boolean isSuccess() {
        return null != errCode && 0 == errCode;
    }

    public boolean isError() {
        return errCode != null && 0 != errCode;
    }

    @JSONField(name = "errcode")
    private Integer errCode;

    @JSONField(name = "errmsg")
    private String errMsg;

    @JSONField(name = "access_token")
    private String accessToken;

    @JSONField(name = "expires_in")
    private Integer expiresIn;
}
